var $ = require('../../utils/Ajax.js');
Page({
  data: {
    Bank: null,
    // 图片地址
    PictureUrl: getApp().PictureUrl
    // Radio: null
  },
  onLoad: function (options) {
    var that = this;
    wx.setNavigationBarTitle({
      title: "选择卡类型"
    }) 
    $.Ajax("api/x_bank", "POST", {}, function (res){
      console.log(res)
      that.setData({
        Bank: res.d.bank
      })
    });
  },
  radioChange: function (e) {
    var pages = getCurrentPages();
    var prevPage = pages[pages.length - 2];
    var BankInfor = e.detail.value
    var Bank = BankInfor.split(',');
    prevPage.setData({
      BankType: Bank[0],
      BankLogo: Bank[1],
      BankName: Bank[2]
    })
    wx.navigateBack({
      delta: 1
    })
  }
})